import { request } from "./request";
const marketApi = {
    /**-----------平台端优惠券-------------------- */
    findCouponList: (params: any) => {
        return request({
            params,
            url: '/jsCoupon/manage/findCouponList',
            method: 'get',
        })
    },
    addOrUpdateCoupon: (data: any) => {
        return request({
            data,
            url: '/jsCoupon/manage/addOrUpdateCoupon',
            method: 'post',
        })
    },
    findAllStore: (params: any) => {
        return request({
            params,
            url: '/jsAccount/findAllStore',
            method: 'get',
        })
    },
    deleteCoupon: (id:string) => {
        return request({
            url: `/jsCoupon/manage/deleteCoupon/${id}`,
            method: 'delete',
        })
    },
    removeActivity: (id:string) => {
        return request({
            url: `/jsActivity/removeActivity/${id}`,
            method: 'delete',
        })
    },
    findCouponDetail: (id: string) => {
        return request({
            url: '/jsCoupon/manage/findCouponDetail?couponId='+id,
            method: 'get',
        })
    },
    sponsorStoreAffirm: (id: string) => {
        return request({
            url: '/jsCoupon/manage/sponsorStoreAffirm?couponId='+id,
            method: 'get',
        })
    },
    submitActivity: (id: string) => {
        return request({
            url: `/jsActivity/submitActivity/${id}`,
            method: 'post',
        })
    },
    anewGenerateActivity: (id: string) => {
        return request({
            url: '/jsCoupon/manage/anewGenerateActivity?id='+id,
            method: 'get',
        })
    },
    activityAudit: (data: any) => {
        return request({
            data,
            url: '/jsCoupon/manage/activityAudit',
            method: 'post',
        })
    },
    jsActivityactivityAudit: (data: any) => {
        return request({
            data,
            url: '/jsActivity/activityAudit',
            method: 'post',
        })
    },
    publishActivity: (data: any) => {
        return request({
            data,
            url: `/jsActivity/publishActivity/${data.id}`,
            method: 'post',
        })
    },
    offlineActivity: (data: any) => {
        return request({
            data,
            url: `/jsActivity/offlineActivity/${data.id}`,
            method: 'post',
        })
    },
    republishActivity: (data: any) => {
        return request({
            data,
            url: `/jsActivity/republishActivity/${data.id}`,
            method: 'post',
        })
    },
    suspendActivity: (data: any) => {
        return request({
            data,
            url: `/jsActivity/suspendActivity`,
            method: 'post',
        })
    },

    updateCouponStatus: (data: any) => {
        return request({
            data,
            url: '/jsCoupon/manage/updateCouponStatus',
            method: 'put',
        })
    },
    saveAndGenerateActivityLink: (data: any) => {
        return request({
            data,
            url: '/jsCoupon/manage/saveAndGenerateActivityLink',
            method: 'post',
        })
    },
    previewActivityPage: (id: string) => {
        return request({
            url: '/jsCoupon/manage/previewActivityPage?couponId='+id,
            method: 'get',
        })
    },
    getCouponInfoH5: (params: any) => {
        return request({
            params,
            url: '/activity/coupon/info',
            method: 'get',
        })
    },
    getActivityInfoH5: (params: any) => {
        return request({
            params,
            url: '/activity/coupon/findActivity',
            method: 'get',
        })
    },
    CouponReceiveH5: (data: any) => {
        return request({
            data,
            url: '/activity/coupon/receive',
            method: 'post',
        })
    },
    receiveActivityCoupons: (data: any) => {
        return request({
            data,
            url: '/activity/coupon/receiveActivityCoupons',
            method: 'post',
        })
    },





    /**-----------------机构端优惠券----------------- */
    addOrUpdateExclusiveCoupon: (data: any) => {
        return request({
            data,
            url: '/jsCoupon/organ/manage/addOrUpdateExclusiveCoupon',
            method: 'post',
        })
    },
    addOrganOrUpdateCoupon: (data: any) => {
        return request({
            data,
            url: '/jsCoupon/organ/manage/addOrUpdateCoupon',
            method: 'post',
        })
    },

    findOwnCouponList: (params: any) => {
        return request({
            params,
            url: '/jsCoupon/organ/manage/findOwnCouponList',
            method: 'get',
        })
    },
    findActivity: (params: any) => {
        return request({
            params,
            url: '/jsActivity/findActivity',
            method: 'get',
        })
    },

    findCouponListByOrganizationId: (params: any) => {
        return request({
            params,
            url: '/jsCoupon/organ/manage/findCouponListByOrganizationId',
            method: 'get',
        })
    },
    participationActivity: (data: any) => {
        return request({
            data,
            url: '/jsCoupon/organ/manage/participationActivity',
            method: 'post',
        })
    },
    jsActivityparticipationActivity: (data: any) => {
        return request({
            data,
            url: '/jsActivity/participationActivity',
            method: 'post',
        })
    },
    findCouponUsageRecordList: (params: any) => {
        return request({
            params,
            url: '/jsCoupon/manage/findCouponUsageRecordList',
            method: 'get',
        })
    },
    findCouponDetailWithUsage: (params: any) => {
        return request({
            params,
            url: '/jsCoupon/manage/findCouponDetailWithUsage',
            method: 'get',
        })
    },
}
export default marketApi